def GetfileType(filename):

	filetype = filename.split('.')[-1]
	if filetype == 'doc':
		filetype = 'application/msword'
	elif filetype == 'docx':
		filetype = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
	elif filetype == 'ods':
		filetype = 'application/x-vnd.oasis.opendocument.spreadsheet'
	elif filetype == 'odt':
		filetype = 'application/vnd.oasis.opendocument.text'
	elif filetype == 'pdf':
		filetype = 'application/pdf'
	elif filetype == 'ppt':
		filetype = 'application/vnd.ms-powerpoint'
	elif filetype == 'pps':
		filetype = 'application/vnd.ms-powerpoint'
	elif filetype == 'txt':
		filetype = 'text/plain'
	elif filetype == 'rtf':
		filetype = 'application/rtf'
	elif filetype == 'html':
		filetype = 'text/html'
	elif filetype == 'xls':
		filetype = 'application/vnd.ms-excel'
	elif filetype == 'xlsx':
		filetype = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
	elif filetype == 'pps':
		filetype = 'application/vnd.ms-powerpoint'
	elif filetype == 'mp3':
		filetype = 'audio/mpeg'
	return filetype
	
